LEK Installation ================= .. _More : https://www.elastic.co/support/matrix#show_os Support Matrix | Requirements (Refer to More_) ------------------------------ * Product and Operating System .. _img_01: .. figure:: _static/img/ProductAndOperationSystem.jpg * Product and JVM .. _img_02: .. figure:: _static/img/ProductAndJVM.jpg * Supported Browsers .. _img_03: .. figure:: _static/img/SupportedBrowsers.jpg * Product Compatibility .. _img_04: .. figure:: _static/img/ProductCompatibility.jpg Development Machine Environment ------------------------------- * OS: OS X EI Capitan, Version 10.11.3 * JDK: 1.7.0_71 .. _Logstash-reference : https://www.elastic.co/guide/en/logstash/current/index.html Logstash Installation --------------------- .. _logstash-2.2.2.tar.gz : https://download.elastic.co/logstash/logstash/logstash-2.2.2.tar.gz 1. Download Logstash 2.2.2 (logstash-2.2.2.tar.gz_) 2. Unzip .. figure:: _static/img/tarlogstash.png 3. Create configuration file .. code:: ``stevelee@SteveLee ‣ ~/Develop/logstash-2.2.2 ‣ vi myconf.conf`` .. code:: ``# The # character at the beginning of a line indicates a comment. Use`` ``# comments to describe your configuration.`` ``input {`` ``stdin {`` ``}`` ``}`` ``# The filter part of this file is commented out to indicate that it is`` ``# optional.`` ``# filter {`` ``#`` ``# }`` ``output {`` ``stdout {`` ``}`` ``}`` 4. Run .. code:: ``stevelee@SteveLee ‣ ~/Develop/logstash-2.2.2 ‣ ./bin/logstash -f myconf.conf`` When terminal show "Logstash startup completed", then you can type any words in terminal , such as "My First Logstash ,Oye!", Terminal will output "2016-03-11T08:30:17.509Z SteveLee My First Logstash ,Oye!". If you want o quit, just click Ctrl + D , logstash will be killed. (You also can use ps -ef |grep logstash to get pid, and kill that . .. figure:: _static/img/logstashrun.png 5. Logstash Architecture .. figure:: _static/img/logstasharchitecture.png 6. Advanced 7. Reference (https://www.elastic.co/guide/en/logstash/current/index.html) ElasticSearch Installation --------------------- .. _elasticsearch-2.2.0.tar.gz : https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/2.2.0/elasticsearch-2.2.0.tar.gz 1. Download Elasticsearch 2.2.0 (elasticsearch-2.2.0.tar.gz_) 2. Unzip .. figure:: _static/img/tarelasticsearch.png 3. Modify configuration file(elasticsearch.yml) .. code:: ``stevelee@SteveLee ‣ ~/Develop/elasticsearch-2.2.0 ‣ vi ./config/elasticsearch.yml`` .. code:: ``uncomment cluster.name, and set cluster.name: my-application-steve_dev`` .. code:: ``uncomment node.name, and set node.name: steve_node_1_dev`` 4. Run .. code:: ``stevelee@SteveLee ‣ ~/Develop/elasticsearch-2.2.0 ‣ ./bin/elasticsearch &`` .. figure:: _static/img/elasticsearchrun.png 5. CRUD **a.Create an index** *Input the following code to terminal:* .. code:: ``curl -XPUT 'localhost:9200/customer?pretty'`` *If created successfully, will show the following information:* .. code:: ``{`` ``"acknowledged" : true`` ``}`` **b.Create one recode to customer** *Input the following code to terminal:* .. code:: ``curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '`` ``{`` ``"name": "John Doe"`` ``}'`` *You will see the below response.* ``{`` ``"_index" : "customer",`` ``"_type" : "external",`` ``"_id" : "1",`` ``"_version" : 1,`` ``"_shards" : {`` ``"total" : 2,`` ``"successful" : 1,`` ``"failed" : 0`` ``},`` ``"created" : true`` ``}`` **c.Retrieve one recode from customer** .. code:: ``curl -XGET .......`` **d.Delete one recode from customer** .. code:: ``curl -XDELETE .......`` **e.Update one recode from customer** .. code:: ``curl -XPUT .......`` 6. ElasticSearch Architecture .. figure:: _static/img/elasticsearcharchitecture.png 7. Advanced 8. Plugin .. _Marvel : https://www.elastic.co/downloads/marvel ⁃*Marvel helps you keep a pulse on the state of your Elasticsearch deployment. As a window into your cluster, Marvel is a tool for optimizing your Elasticsearch performance and diagnosing issues quickly.* (See More Marvel_) .. _Head : https://github.com/mobz/elasticsearch-head ⁃*Head, a web front end for an Elasticsearch cluster.* (See More Head_) See more plugins, please visit => https://www.elastic.co/guide/en/elasticsearch/plugins/2.2/plugin-management.html .. figure:: _static/img/elasticsearchpluginhead.png 9. Reference (https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html) 10. Other Tools .. _VisualVM : http://visualvm.java.net ⁃*VisualVM is a visual tool integrating several commandline JDK tools and lightweight profiling capabilities. Designed for both production and development time use, it further enhances the capability of monitoring and performance analysis for the Java SE platform.* (See More VisualVM_) Kibana Installation --------------------- .. _kibana-4.4.2-darwin-x64.tar.gz : https://download.elastic.co/kibana/kibana/kibana-4.4.2-darwin-x64.tar.gz 1. Download Kibana 4.4.2 (kibana-4.4.2-darwin-x64.tar.gz_) 2. Unzip .. figure:: _static/img/tarkibana.png 3. Run (Make sure that run elasticsearch service before run kibana, & means you will run the service in background) .. code:: ``stevelee@SteveLee ‣ ~/Develop/kibana-4.4.1-darwin-x64 ‣ ./bin/kibana &`` .. figure:: _static/img/kibanarun.png 4. Stop *You need to find the pid via port, Then, you can kill the process via pid.* .. code:: ``stevelee@SteveLee ‣ ~/Develop/kibana-4.4.1-darwin-x64 ‣ lsof -iTCP:5601 | grep LISTEN`` *You need to find the pid via process name, Then, you can kill the process via pid. The kibana's process name is node, not kibnan, please refer to bin/kibana script file.* .. code:: ``stevelee@SteveLee ‣ ~/Develop/kibana-4.4.1-darwin-x64 ‣ ps -ef |grep node`` 5. Access Kibana http://127.0.0.1:5601 .. figure:: _static/img/kibanarun2.png 6. Advanced 7. Plugin(Sense) .. _Sense : https://www.elastic.co/guide/en/sense/current/introduction.html *Sense is a handy console for interacting with the REST API of Elasticsearch.* (See More Sense_) 7. Reference (https://www.elastic.co/guide/en/kibana/current/introduction.html)